#ifndef KNOWLEDGE_EVOLVER_H
#define KNOWLEDGE_EVOLVER_H

#include <vector>
#include "src/knowledge/base/knowledge_unit.h"
#include "src/core/evolution/autonomous_learner.h"

class EvolutionRecord {
public:
    LearningProblem problem;
    SemanticReasoningResult result;
    std::chrono::system_clock::time_point timestamp;
    
    EvolutionRecord(const LearningProblem& p, const SemanticReasoningResult& r)
        : problem(p), result(r), timestamp(std::chrono::system_clock::now()) {}
};

class KnowledgeEvolver {
private:
    std::vector<KnowledgeUnit*> knowledgeBase;
    std::vector<EvolutionRecord> evolutionHistory;
    
public:
    // 记录学习案例
    void recordLearningCase(const LearningProblem& problem, 
                          const SemanticReasoningResult& result);
    
    // 知识库进化
    void evolve(const PerformanceMetrics& metrics);
    
    // 识别进化候选者
    std::vector<KnowledgeUnit*> identifyEvolutionCandidates(
        const PerformanceMetrics& metrics);
    
    // 应用进化策略
    void applyEvolutionStrategy(KnowledgeUnit* unit, 
                              const PerformanceMetrics& metrics);
};

#endif // KNOWLEDGE_EVOLVER_H